package com.koron.operation.keepcontext.mapper;

import com.koron.operation.keepcontext.bean.KeepContactBean;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.Date;
import java.util.List;

public interface KeepContactMapper {
    int deleteByPrimaryKey(String id);

    int insert(KeepContactBean record);

    int insertSelective(KeepContactBean record);

    KeepContactBean selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(KeepContactBean record);

    int updateByPrimaryKey(KeepContactBean record);

    int updateBatchSelective(List<KeepContactBean> list);

    int batchInsert(@Param("list") List<KeepContactBean> list);

    List<KeepContactBean> queryByBusinessAndMyAccount(@Param("business") String business, @Param("myaccount") String myaccount);

    int deleteByIdNotIn(@Param("idCollection") Collection<String> idCollection, @Param("business") String business, @Param("myaccount") String myaccount);

    // 按账号前20名
    List<KeepContactBean> querytop20OnMyAccount(@Param("acclist") List<String> acclist);

    // 权重7天内未更新 且 权重排行小于20名 且 权重小于等于3，移除
    int deleteByUpdateTimeBeforeAndWeightBeforeAndIdIn(@Param("maxUpdateTime")Date maxUpdateTime, @Param("idCollection")Collection<String> idCollection);

    List<String> findDistinctMyAccount();


}